var cols = [
    {name: 'name', display: '名称', width: 40, type: 'text', disabled: true},
    {name: 'type', display: '类型', width: 40, type: 'text', disabled: true,text_align:"left"},
    {name: 'discription', display: '描述', width: 150, type: 'text', disabled: true,text_align:"left"},
    {name:'default',display:'默认值',width:40,type:'text', disabled: true,text_align:"left"}
];




var rowsslider = [
    {"name": "$valueMax", "type": "number", "discription": "组件最大值", "default": "100"},
    {"name": "$valueMin", "type": "number", "discription": "组件最小值", "default": "0"},
    {"name": "range", "type": "bool", "discription": "滑块是否显示滑动范围(true,max,min)", "default": "false"},
    {"name": "step", "type": "number", "discription": "滑块滑动的步值", "default": "1"},
    {"name": "value", "type": "number", "discription": "滑块的当前值", "default": "0"},
    {"name": "values", "type": "[ ]", "discription": "滑块当前值,当range为true时,value是滑块范围表示的两个值,以,分割", "default": "null"},
    {"name": "disabled", "type": "bool", "discription": "是否禁用滑块,设为true时滑块禁用", "default": "false"},
    {"name": "onDragStart", "type": "function", "discription": "滑动开始的回调", "default": ""},
    {"name": "onDrag", "type": "function", "discription": "滑动时的回调", "default": ""},
    {"name": "onDragEnd", "type": "function", "discription": "滑动结束的回调", "default": ""}
];

avalon.library("aoyou", {
    $ready: function () {
        avalon.log("控件已经构建完毕")
    }
})

define(["../../component/slider/avalon.slider","../../component/newtable/avalon.newtable"], function(){
    var sv = avalon.define({
        $id:"test1",
        value:0,
        percent:"0",
        $valueMin:"0",
        $valueMax:"100",
        $slideropts: {
            $valueMin:'0',
            $valueMax:'100',
            step:10,
            onDrag:function (o,data) {
                sv.value = o.value;
                sv.percent = o.percent;
                sv.$valueMin = o.$valueMin;
                sv.$valueMax = o.$valueMax;
            }
        },
        $tdslideropt:{
            title_align:"center",
            title:"滑块属性",
            cols:cols,
            rows:rowsslider,
            autoLoad:true,
            bar:true
        }

    });
    return sv;
});